<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>labahua</title>
  <script>
      var multiply = function(n){
        var sum = 1;
        for (var i = n; i > 0; i--){
            sum *= i;
            console.log(i);
        }
        console.log(sum);
        return sum;
      } 
      var m = function(n){
        var total = 0;
        for (var i = n; i > 0; i--){
            total += multiply(i);
        }
        return total;
      }
      console.log(m(4));

     </script>
</head>
<body>
  
</body>
</html>